#ifndef DBMANAGER_H
#define DBMANAGER_H

#include <QObject>
#include <QSqlDatabase>
#include <QSqlError>
#include <QDebug>

class DbManager : public QObject
{
    Q_OBJECT
public:
    static DbManager &instance(); // 获取单例实例

    QSqlDatabase getDatabase() const;
    bool isOpen() const;

private:
    explicit DbManager(QObject *parent = nullptr);
    ~DbManager();

    QSqlDatabase m_db;
};

#endif // DBMANAGER_H
